/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       buffer_window.h

	$Header: /game/buffer_window.h $

	$NoKeywords: $

 ************************************************************************/
#ifndef BUFFER_WINDOW_H_INCLUDED
#define BUFFER_WINDOW_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "abstract_bitmap_typedef.h"
#include "game_window.h"
#include "shared_ptr.h"
#include "memory_bitmap.h"

// ----------------------------------------------------------------------
// wrapper to hide details of dib section
// note: copy constructor, assignment operator are required to prevent
// the compiler from trying to instantiate the destructor - which would
// prevent forward declaration of t_dib_section16
// ----------------------------------------------------------------------
class t_image_buffer
{
public:
	t_image_buffer();
	t_image_buffer( int width, int height );
	t_image_buffer( t_image_buffer const& arg );
	~t_image_buffer();

	t_abstract_bitmap16* get_bitmap() const;	
	t_image_buffer& operator=( t_image_buffer const& arg );
protected:
	t_shared_ptr<t_memory_bitmap16> m_bitmap;
};


// ----------------------------------------------------------------------
// window which displays a bitmap buffer
// ----------------------------------------------------------------------
class t_buffer_window : public t_window
{
public:
	t_buffer_window( t_screen_point point, t_window* parent = 0 );

	void         set_bitmap( t_image_buffer const& bitmap );
	virtual void paint( t_paint_surface& paint_surface );
protected:
	t_image_buffer m_bitmap;
};


#endif // BUFFER_WINDOW_H_INCLUDED